<?php
include("../db_connect.php");
session_start();
$id =  mysql_real_escape_string($_GET['id']);

$sql1 = "SELECT * FROM tbl_account where id='".$id."'";
$result = mysql_query($sql1);

while($rows = mysql_fetch_array($result) ){
$username = $rows['username'];
$password= $rows['password'];
$fname = $rows['fname'];
$type = $rows['type'];

$_SESSION['id'] = $id;
$_SESSION['username'] = $username ;
$_SESSION['password'] = $password;
$_SESSION['fname']= $fname;
$_SESSION['type'] = $type;


if($type== 1){
		header("location:../admin.php");
	}
	else if($type== 2){
		header("location:../cashier.php");
	}
	else if ($type== 3){
		header("location:../profile.php");
	}

}




?>